/*
 * @Author: szx
 * @Date: 2021-10-28 20:04:56
 * @LastEditTime: 2021-10-28 20:12:47
 * @Description:
 * @FilePath: \leetcode\167\167.cpp
 */
#include <iostream>
#include <vector>
using namespace std;
class Solution {
   public:
    vector<int> twoSum(vector<int>& numbers, int target) {
        int l = 0, r = numbers.size() - 1;
        while (l < r) {
            if (numbers[l] + numbers[r] == target) {
                return vector<int>{l + 1, r + 1};
            } else if (numbers[l] + numbers[r] < target) {
                l++;
            } else {
                r--;
            }
        }
        return {};
    }
};
int main() {}